package com.hnkywl.sts.dao.sys;

import com.hnkywl.sts.entity.sys.Gncz;
import net.ruixin.orm.hibernate.SimpleHibernateTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: ZHUCHG
 * Date: 13-5-8
 * Time: 下午3:04
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class GnczDao extends SimpleHibernateTemplate<Gncz, Long> {
    public List<Gncz> findGnczByJsAndUrl(Set<Long> jsId, String url) {
        String hql = "select distinct gncz from Qx qx inner join qx.jsList js  inner join qx.gnczList gncz with gncz.url=:url where  js.id in (:jsid) order by gncz.pxh";
        return createQuery(hql).setParameterList("jsid", jsId).setString("url", url).list();
    }
}
